import pygame
import sys
import time
#iniciar pigame
pygame.init()
#configurar la ventana
ancho = 253
alto = 220
ventana = pygame.display.set_mode((ancho, alto))
NEGRO = [0, 0, 0]
ventana.fill(NEGRO)
pygame.display.set_caption("Proyect-Pozo")

mi_fondo = pygame.image.load("img/fondo.png")
x,y = 0,0

ventana.blit(mi_fondo, [x,y])
pygame.display.flip()

kirby = pygame.image.load("img/kirby_2.png")
x_kirby,y_kirby = 0,100

ventana.blit(kirby, [x_kirby,y_kirby])
pygame.display.flip()
#EVENTOS Y COSAS CHUNGAS
while True:
	for event in pygame.event.get():
		
		if event.type == pygame.QUIT:
			pygame.quit()
			sys.exit()
			
			
		if event.type == pygame.KEYDOWN:
			if event.key == pygame.K_DOWN:
				ventana.blit(mi_fondo, [x,y])
				y_kirby = y_kirby + 10
				ventana.blit(kirby, [x_kirby,y_kirby])
				pygame.display.flip()
				
			if event.key == pygame.K_UP:
				ventana.blit(mi_fondo, [x,y])
				y_kirby = y_kirby - 10
				ventana.blit(kirby, [x_kirby,y_kirby])
				pygame.display.flip()
				
			if event.key == pygame.K_RIGHT:
				ventana.blit(mi_fondo, [x,y])
				x_kirby = x_kirby + 10
				ventana.blit(kirby, [x_kirby,y_kirby])
				pygame.display.flip()
				
			if event.key == pygame.K_LEFT:
				ventana.blit(mi_fondo, [x,y])
				x_kirby = x_kirby - 10
				ventana.blit(kirby, [x_kirby,y_kirby])
				pygame.display.flip()
				
           
